<?php

namespace app\admin\model;

use think\Model;

class AlarmRecord extends Model
{
    //

    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = false;


    public function getReasonTxtAttr($value, $data)
    {
        $statuses = [
            1 => '用章超过次数',
            2 => '用章完成超时没有上传图片',
            3 => '用章超过时间',
        ];
        return $statuses[$data['reason']];
    }

    public function user()
    {
        return $this->belongsTo('User', 'uid');
    }

    public function appForm()
    {
        return $this->belongsTo('AppForm', 'app_id');
    }

    public function seal()
    {
        return $this->belongsTo('Seal', 'seal_id');

    }
}
